package es

import (
	"fmt"
	"github.com/elastic/go-elasticsearch/v7"
)

var Es *elasticsearch.Client

func InitEs() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://14.103.149.194:9200",
		},
		// ...
	}
	Es, err = elasticsearch.NewClient(cfg)
	if err != nil {
		panic(err)
	}
	fmt.Println("es连接成功")
}
